package com.shop.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.shop.pojo.sms.Sms_Home_Subject;
import com.shop.service.Sms_Home_Subject_Service;
import com.shop.utils.LayuiUtils;
import com.shop.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 专题列表-李贝贝
 */
@RestController
@RequestMapping("/home_subject")
public class Sms_Home_Subject_Controller {

    @Autowired
    private Sms_Home_Subject_Service sms_home_subject_service;

    /**
     * 显示所有
     * @param page
     * @param limit
     * @param sms_home_subject
     * @return
     */
    @GetMapping("/find_Admin_All_Home_Subject")
    public LayuiUtils<Sms_Home_Subject> find_Admin_All_Home_Subject(Integer page, Integer limit, Sms_Home_Subject sms_home_subject){
        Page<Sms_Home_Subject> pages = new Page<>(page,limit);
        return sms_home_subject_service.find_admin_all_home_subject(pages,sms_home_subject);
    }

    /**
     * 新增
     * @param sms_home_subject
     * @return
     */
    @PostMapping("/insert_Admin_Home_Subject")
    public R insert_Admin_Home_Subject(Sms_Home_Subject sms_home_subject){
        return sms_home_subject_service.insert_admin_home_subject(sms_home_subject);
    }

    /**
     * 删除
     * @param id
     * @return
     */
    @DeleteMapping("/delete_Admin_Home_Subject")
    public R delete_Admin_Home_Subject(@RequestParam List<Long> id){
        return sms_home_subject_service.delete_admin_home_subject(id);
    }

    /**
     * 修改
     * @param sms_home_subject
     * @return
     */
    @PutMapping("/update_Admin_Home_Subject")
    public R update_Admin_Home_Subject(Sms_Home_Subject sms_home_subject){
        return sms_home_subject_service.update_admin_home_subject(sms_home_subject);
    }
}

